﻿namespace Chapter02.DesginModeBcl {
    public class CurrentConditionsDisplay : IObserver<WeatherInfo> {
        private IDisposable? disposable;

        public void Subscribe(WeatherData provider) {
            disposable = provider.Subscribe(this);
        }

        public virtual void Unsubscribe() {
            disposable?.Dispose();
        }

        public void OnCompleted() {
            throw new NotImplementedException();
        }

        public void OnError(Exception error) {
            throw new NotImplementedException();
        }

        public void OnNext(WeatherInfo value) {
            Console.WriteLine(value);
        }
    }
}
